package leave.status;

import java.util.*;

public enum LeaveStatus {
	APPLIED("Applied"),
	UPDATED("Updated"),
	APPROVED("Approved"),
	REJECTED("Rejected"),
	CANCELLED("Cancelled"),
	DELETED("Deleted"),
	ACHIEVED("Achieved");
	
	private String statusDescription;
	
	LeaveStatus(String description){
		this.statusDescription = description;
	}
	
	public static LeaveStatus getStatus(String description){
		HashMap<String, LeaveStatus> StatusMap = new HashMap<String, LeaveStatus>();
		StatusMap.put(LeaveStatus.APPLIED.statusDescription, LeaveStatus.APPLIED);
		StatusMap.put(LeaveStatus.UPDATED.statusDescription, LeaveStatus.UPDATED);
		StatusMap.put(LeaveStatus.APPROVED.statusDescription, LeaveStatus.APPROVED);
		StatusMap.put(LeaveStatus.REJECTED.statusDescription, LeaveStatus.REJECTED);
		StatusMap.put(LeaveStatus.CANCELLED.statusDescription, LeaveStatus.CANCELLED);
		StatusMap.put(LeaveStatus.DELETED.statusDescription, LeaveStatus.DELETED);
		StatusMap.put(LeaveStatus.ACHIEVED.statusDescription, LeaveStatus.ACHIEVED);
		return (LeaveStatus) StatusMap.get(description);
	}
	
	public String getStatusDescription(){
		return statusDescription;
	}
}
